<ul class="doc-side-nav">

	{% assign components = page.path | downcase | split: '/' %}
	{% assign section = components[1] %}
	{% assign foundSection = false %}

	{% assign docs = site.docs %}
	{% for d in docs %}
        {% if d.draft == true %}
    	    {% continue %}
        {% endif %}

		{% assign components = d.path | downcase | split: '/' %}
		{% if components[1] == section %}
			{% if components[2] == 'index.md' %}
	            {% assign foundSection = true %}
				<li><h5 class='doc-side-nav-title'>{{d.title}}</h5></li>
			{% endif %}
        {% endif %}
	{% endfor %}

	{% if foundSection == true %}
	<script type="text/javascript">
        var docs = [];
        {% for d in docs %}
            {% if d.draft == true %}
                {% continue %}
            {% endif %}

	        {% assign components = d.path | downcase | split: '/' %}
			{% if components[1] == section %}
		        docs.push({path: [
		        {% for comp in components %}
        			{% if forloop.index > 2 %}
        				"{{ comp }}",
        			{% endif %}
        		{% endfor %}
				{% assign order = d.order %}
				{% if d.order == nil %}
				{% assign order = 9999 %}
				{% endif %}
                {% assign url = d.url | remove: "index.html" %}
        		], url: "{{url}}", title: "{{d.title}}", order: {{order}}, overview: "{{d.overview}}"});
		    {% endif %}
        {% endfor %}

		genNavBarTree(docs)
	</script>
	{% endif %}
</ul>
